#pragma once

#include "../umlmodel_global.h"
#include "BaseElement.h"

namespace uml {

{% for cls in model.classes %}
class {{ cls.name }};
{% endfor %}

/// <summary>
/// JsonSerializable
/// </summary>
class UMLMODEL_EXPORT JsonSerializable {
public:
    template <class T>
    static T* create(const QJsonObject& json, QStringList& errorList);
    static BaseElement* createBaseElement(
        const QJsonObject& json,
        QStringList& errorList
    );

{% for cls in model.classes %}
    static {{ cls.name }}* create{{ cls.name }}(const QJsonObject& json, QStringList& errorList);
{%endfor %}

protected: // Fields
    static QMap<QString, BaseElement* (*)()> typeMap_;
};
} // namespace uml
